<template>
	<view class="setting-container">
		<uni-nav-bar title="设置" left-icon="back" @clickLeft="$tab.back()" :border="false" :fixed="true"
			:statusBar="true"></uni-nav-bar>

		<view class="bg-FFF px-32 py-32 mt-16">
			<view class="text-24 text-gray">
				账号与安全
			</view>
			<view class="text-28 flex items-center justify-between mt-24" @click="$tab.nav(`/pages/mine/setting/account`)">
				<view class="">
					账号与安全
				</view>
				<u-icon name="arrow-right" color="#000"></u-icon>
			</view>
		</view>

		<view class="bg-FFF px-32 py-32 mt-16">
			<view class="text-24 text-gray">
				关于富乐万家
			</view>
			<view class="" v-for="(item,index) in list" :key="index" @click="goPage(item)">
				<view class="text-28 flex items-center justify-between mt-24">
					<view class="">
						{{item.title}}
					</view>
					<u-icon name="arrow-right" color="#000"></u-icon>
				</view>
				<u-divider></u-divider>
			</view>
		</view>

		<view class="mt-48 px-32">
			<view class="py-24 round-12 text-32 text-FFF text-center btn" @click="exit">
				退出登录
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: null,
			}
		},
		onLoad() {
			this.list = getApp().globalData.config.appInfo.agreements.filter(item => {
				return item.title == '隐私协议' || item.title == '用户协议' || item.title == "问题反馈"
			})
		},
		methods: {
			goPage(item) {
				this.$tab.nav(`/pages/common/webview/index?title=${item.title}&url=${item.url}`)
			},
			exit() {
				this.$store.dispatch('LogOut').then(res => {
					this.$tab.reLaunch('/pages/logo')
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #F8F8F8;
	}
</style>

<style lang="scss" scoped>
	.btn {
		background: linear-gradient(180deg, #FF561D 33%, #FF0064 100%);
	}
</style>